var mongoose = require('mongoose');    //引用mongoose模块
mongoose.connect('mongodb://localhost:13000/familydb');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function (callback) {
  console.log('connection success');
});
module.exports = db;